package com.data.modules.online.config.datasourceConfig;

import com.data.common.util.ConvertUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.master")
@Component("dataBaseConfig")
public class DataBaseConfig {

    private String f411a;

    private String f412b;

    private String f413c;

    private String f414d;
    @Autowired
    private DmDataBaseConfig dmDataBaseConfig;

    private Druid f415e;

    public Druid getDruid() {
        if (this.f415e == null) {
            return this.dmDataBaseConfig.getDruid();
        }
        return this.f415e;
    }

    public void setDruid(Druid druid) {
        this.f415e = druid;
    }

    public String getUrl() {
        return ConvertUtils.getString(this.f411a, this.dmDataBaseConfig.getUrl());
    }

    public void setUrl(String url) {
        this.f411a = url;
    }

    public String getUsername() {
        return ConvertUtils.getString(this.f412b, this.dmDataBaseConfig.getUsername());
    }

    public void setUsername(String username) {
        this.f412b = username;
    }

    public String getPassword() {
        return ConvertUtils.getString(this.f413c, this.dmDataBaseConfig.getPassword());
    }

    public void setPassword(String password) {
        this.f413c = password;
    }

    public String getDriverClassName() {
        return ConvertUtils.getString(this.f414d, this.dmDataBaseConfig.getDriverClassName());
    }

    public void setDriverClassName(String driverClassName) {
        this.f414d = driverClassName;
    }

    public void setDmDataBaseConfig(DmDataBaseConfig dmDataBaseConfig2) {
        this.dmDataBaseConfig = dmDataBaseConfig2;
    }
}
